#ifndef __SOCKET_LISTENING_H__
#define __SOCKET_LISTENING_H__

#include "socket.h"

/**
 * A "Listening Socket" is a special application of eSocket, that
 *   listens for incoming connections.
 *
 *   Its most common use is for TCP-based communication, on the
 *     server-side.
 *
**/
class eListeningSocket : public eSocket {
public:
           eListeningSocket (void) : eSocket () { }
  virtual ~eListeningSocket (void)              { }

  eSocket* accept (void);        /* _BLOCKS_ until a connection is made. */
  bool     listen (int backlog);
  bool     select (int msecs);   /* Returns true if the socket has data. */

private:
  fd_set        fds_;            /* Used for UNIX Select (...) logic. */
  unsigned char max_queue;
};

#endif /* __SOCKET_LISTENING_H__ */
